<?php namespace Cms\Api;

use Hdphp\Api\Api;

class Access extends Api
{
	protected $error;

	/**
	 * 验证登录
	 * @return boolean
	 */
	public function isLogin()
	{
		if(isset($_SESSION['user']))
		{
			return true;
		}
		else
		{
			$this->error = '帐号未登录';
			return false;
		}
	}

	/**
	 * 后台登录权限检测
	 * @return boolean [description]
	 */
	public function verify()
	{
		if(!Rbac::verify())
		{
			$this->error = '没有操作权限';
			return false;
		}
		return true;
	}
}